package br.com.j7.jdesk.persistence.listener;

import javax.persistence.EntityManager;
import javax.persistence.PostPersist;
import javax.persistence.PrePersist;

import br.com.j7.jdesk.library.util.JPAUtis;
import br.com.j7.jdesk.persistence.entity.Users;
import br.com.j7.jdesk.persistence.repository.impl.LogRepositoryImpl;

/**
 * 
 * 
 * @author Edivando Alves
 *
 */
public class UserListener {
	
	public UserListener() {
	}
	
	@PrePersist
	public void prePersist(Users user){
//		System.out.println("Presistindo Usuario");
	}
	
	@PostPersist
	public void postPersist(Users user){
//		String action = "Added user with name: "+user.getCdUser();
//		EntityManager manager = JPAUtis.getInstance().beginManager();
//		new LogRepositoryImpl(manager).addLog(action);
//		manager.getTransaction().commit();
	}

}
